<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>v-model结合radio</title>
  <style>
    #app {
      margin-top: 50px;
      text-align: center;
    }

    .gender {
      color: seagreen;
    }
  </style>
</head>

<body>

  <div id="app">
    <!-- 两个input的单选框使用v-model绑定同一个Model变量后，可省略name -->
    <label for="male"><input type="radio" id="male" v-model="sex" value="男"> 男</label>
    <label for="female"><input type="radio" id="female" v-model="sex" value="女"> 女</label>

    <h4>您选择的性别是 <label class="gender">{{ sex }}</label></h4>
  </div>

  <script src="../../js/vue.js"></script>
  <script>
    const app = new Vue({
      el: '#app',
      data: {
        message: 'hello',
        sex: "男"
      }
    })
  </script>
</body>

</html>